{extend name='admin@public/content'}

{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("$classuri/adveredit")}' data-title="添加广告" class='layui-btn layui-btn-sm layui-btn-primary'>添加广告</button>
<!--{/if}-->

<!--{if auth("$classuri/del")}-->
<button data-update data-field='forbid' data-action='{:url("$classuri/adverstatus")}' class='layui-btn layui-btn-sm layui-btn-primary'>启用</button>
<button data-update data-field='resume' data-action='{:url("$classuri/adverstatus")}' class='layui-btn layui-btn-sm layui-btn-primary'>禁用</button>
<button data-update data-field='delete' data-action='{:url("$classuri/adverstatus")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除</button>
<!--{/if}-->
{/block}

{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline">
            <select name="status" class='layui-select' lay-search="" style="height: 32px;display: block;">
                <option value='' {empty name="Think.get.status" }selected{
                /empty}>全部状态</option>
                <option value='0' {eq name="Think.get.status" value="0" }selected{
                /eq}>冻结</option>
                <option value='1' {eq name="Think.get.status" value="1" }selected{
                /eq}>正常</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">操作</label>
        <div class="layui-input-inline">
            <select name="field" class='layui-select' lay-search="" style="height: 32px;display: block;">
                <option value='username' {eq name="Think.get.field" value="username" }selected{
                /eq}>发布人</option>
                <option value='title' {eq name="Think.get.field" value="title" }selected{
                /eq}>广告简介</option>
                <option value='url' {eq name="Think.get.field" value="url" }selected{
                /eq}>广告URL</option>
                <option value='id' {eq name="Think.get.field" value="id" }selected{
                /eq}>ID</option>
            </select>
        </div>
        <div class="layui-input-inline">
            <input name="name" value="{$Think.get.name|default=''}" placeholder="请输入要查询的内容" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>
</form>
<script>
    window.laydate.render({range: true, elem: '#range-date'});
</script>
<!-- 表单搜索 结束 -->
<form onsubmit="return false;" data-auto="true" method="post">
    <!--{empty name='list'}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{else}-->
    <input type="hidden" value="resort" name="action">
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none="" data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>ID</th>
            <th class='text-left nowrap'>发布人</th>
            <th class='text-left nowrap'>广告简介</th>
            <th class='text-left nowrap'>广告URL</th>
            <th class='text-left nowrap'>图片</th>
            <th class='text-left nowrap'>添加时间</th>
            <th class='text-left nowrap'>编辑时间</th>
            <th class='text-left nowrap'>状态</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        <tbody>
        <!--{foreach $list as $key=>$vo}-->
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <td class='text-left nowrap'>
                {$vo.id}
            </td>
            <td class='text-left nowrap'>
                {$vo['adminid']|get_operation_info}
            </td>
            <td class='text-left nowrap'> 
                {$vo['title']}
            </td>
            <td class='text-left nowrap'>
                {$vo['url']}
            </td>
            <td class='text-left nowrap'>
                <img data-tips-image style="width: 30px;height: 20px;" src="{$vo.img}" alt="">
            </td>
            <td class='text-left nowrap'>
                {$vo['addtime']|addtime}
            </td>
            <td class='text-left nowrap'>{$vo['endtime']|addtime}</td>
            <td class='text-left nowrap'>
                {if $vo.status eq 0}
                    <span class="color-red">已禁用</span>
                {elseif $vo.status eq 1}
                    <span class="color-green">使用中</span>
                {/if}
            </td>
            <td class='text-left nowrap'>
                {if auth("$classuri/edit")}
                    <span class="text-explode">|</span>
                    <a data-title="编辑广告" data-modal='{:url("$classuri/adveredit")}?id={$vo.id}'>编辑</a>
                {/if}
            </td>
        </tr>
        <!--{/foreach}-->
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    <!--{/empty}-->
</form>
{/block}